const {ccclass, property} = cc._decorator;
import PlayerControl from "./PlayerControl"

@ccclass
export default class NewClass extends cc.Component {

    @property(PlayerControl)
    plane: PlayerControl = null;

    onLoad () {
        this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
        this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
        this.node.on(cc.Node.EventType.TOUCH_END, this.onTouchEnd, this);
    }

    start () {

    }

    
    onTouchStart () {
    }

    onTouchMove (e) {
        this.plane.changePosition(e.getDelta());
    }

    onTouchEnd () {

    }

    // update (dt) {}
}
